#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

struct Student {
    std::string name;
    int age;
    double score;

    Student(const std::string& n, int a, double s) : name(n), age(a), score(s) {}

    bool operator<(const Student& other) const {
        if (name != other.name) {
            return name < other.name;
        }
        if (age != other.age) {
            return age > other.age;
        }
        return score > other.score;
    }
};

int main() {
    std::vector<Student> students = {{"Tom", 20, 78.5},
                                     {"Alice", 18, 90.0},
                                     {"Bob", 22, 82.5},
                                     {"Tom", 19, 85.5},
                                     {"Alice", 20, 90.0}};

    std::sort(students.begin(), students.end());

    std::cout << "Sorted students:" << std::endl;
    for (const auto& student : students) {
        std::cout << "Name: " << student.name << ", Age: " << student.age << ", Score: " << student.score << std::endl;
    }

    return 0;
}